<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=yes" />
    <title>VehiclePhysicsSample.Web</title>
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Barlow" />
    <link rel="stylesheet" href="styles.css" />
    <script type="text/javascript" src="evergine.js"></script>
</head>

<body class="dark">
    <div id="evergine-canvas-container"></div>
    <div class="help" tabindex="-1">
        <p>Help:</p>
        <ul>
            <li><strong>W,A,S,D or ← → ↑ ↓:</strong> Control the vehicle</li>
            <li><strong>Space: </strong>Brake the vehicle</li>
            <li><strong>C:</strong> Change camera</li>
            <li><strong>Enter, Tab: </strong>Reset the demo</li>
        </ul>
    </div>
    <div id="splash">
        <div id="splash-content">
            <div class="logo-container">
                <img class="logo-img" alt="Evergine logo" />
                <div class="separator"></div>
            </div>
            <div id="loading-bar" class="progress">
                <div>
                    <strong>Loading...</strong>
                    <div class="loading-bar-container">
                        <div id="loading-bar-percentage" class="progress-bar"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- First we load web assembly code -->
    <script src="_framework/blazor.webassembly.js" autostart="false"></script>

    <!-- Then, start loading the assets into the vfs -->
    <script src="assets.js"></script>

    <!-- Finally, run evergine -->
    <script type="text/javascript">
        var app = new App(
            "VehiclePhysicsSample.Web",
            "VehiclePhysicsSample.Web.Program",
            new EvergineModule()
        );
        Blazor.start().then(function () {
            // It is not mandatory to run Evergine now, but it must run after blazor is started
            app.startEvergine();
        });

        //// It is possible to delete the Evergine instance by running
        // app.destroyEvergine();
    </script>
</body>
</html>
